﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RVEAd.LiveClient.Controls
{
    public partial class PMPanel : UserControl
    {
        public DateTime Date { get; set; }

        public PMPanel()
        {
            InitializeComponent();
            this.Load += new EventHandler(PMPanel_Load);
        }

        void PMPanel_Load(object sender, EventArgs e)
        {
            if (!DesignMode)
            {
                LoadData();    
            }
        }

        public void LoadData()
        {
            intervalGridPM1.IntervalName = "PM1";
            intervalGridPM1.Date = Date;
            intervalGridPM1.IntervalType = Business.IntervalEnum.PM1;

            intervalGridPM2.IntervalName = "PM2";
            intervalGridPM2.Date = Date;
            intervalGridPM2.IntervalType = Business.IntervalEnum.PM2;

            intervalGridPM1.LoadData();
            intervalGridPM2.LoadData();
        }
    }
}
